<!DOCTYPE html>
<!--[if lt IE 7 ]><html lang="en" class="ie6 ielt7 ielt8 ielt9"><![endif]--><!--[if IE 7 ]><html lang="en" class="ie7 ielt8 ielt9"><![endif]--><!--[if IE 8 ]><html lang="en" class="ie8 ielt9"><![endif]--><!--[if IE 9 ]><html lang="en" class="ie9"> <![endif]--><!--[if (gt IE 9)|!(IE)]><!--> 
<html lang="en"><!--<![endif]--> 
  <head>
  <base href="/" />
    <meta charset="utf-8">
    <title>登录用户中心</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <!-- Le styles -->
    <link href="css/bootstrap.css" rel="stylesheet">
    <link href="css/login.css" rel="stylesheet">

    <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

    <!-- Le fav and touch icons -->
    <link rel="shortcut icon" href="img/favicon.ico" type="image/x-icon">
    <link rel="icon" href="img/favicon.ico" type="image/x-icon">
  </head>

  <body style="overflow: hidden;">

    <div class="navbar navbar-fixed-top">
      <div class="navbar-inner navbar-height">
        <div class="container">
<!--           <a class="brand" href="index.html"><i class="icon-white icon-arrow-left"></i> 请妥善保管您的注册信息----设计账户安全，请确定周围环境安全！！！</a> -->
        </div>
      </div>
    </div>
    
    <div class="header-top">
        <div class="container">
            <div class="logo-login"><h1>登录用户中心</h1><h5>输入您的用户名和正确的密码</h5></div>
            <div class="company-logo"><h1>空包速递站</h1><h5>安全 . 快捷 . 方便</h5></div>
        </div>
    </div>
    
    <div class="form-login" style="overflow: hidden;height:450px;">
        <div class="container">
           <div class="login-form" style="background: #fff;">
                <form class="f-login" id="login_dom" onsubmit="return formVerific('login')" action="<?php echo site_url('sign/doLogin'); ?>" method="post">
                    <label class="lb-name">用户名</label>
                    <div class="controls">
                      <input type="text" name="user" class="in-width h-large b-grey">
                    </div>
                    <label class="lb-name">密　码</label>
                    <div class="controls">
                      <input type="password" name="pwd" class="in-width h-large b-grey">
                    </div>
                    <div class="help-block"><a href="#">忘记密码 ?</a></br>还不是本站注册用户？<a href="javascript:void(0);" onclick="registerDom()">注册>></a></div>
                    <div class="controls">
                      <button class="btn btn-primary btn-login">登录</button>
                    </div>
                </form>
                <?php if(isset($tips_sms['login'])){?>
                <div class="alert <?php echo $tips_sms['login']['type']; ?>">
                	<button type="button" class="close" data-dismiss="alert">×</button>
                	<strong><?php echo $tips_sms['login']['title']; ?></strong><?php echo $tips_sms['login']['info']; ?></div>
                <?php }?>
           </div>
        </div>
        <div class="container">
           <div class="login-form" style="background: #fff;">
                <form class="f-login" id="register_dom" onsubmit="return formVerific('register')" action="<?php echo site_url('sign/register'); ?>" method="post">
                    <div class="control-group">
	                    <label class="lb-name">登录用户名</label>
	                    <div class="controls">
	                      <input type="text" name="user" class="in-width h-large b-grey">
	                    </div>
                    </div>
                    <div class="control-group">
	                    <label class="lb-name">设置登录密码</label>
	                    <div class="controls">
	                      <input type="password" name="pwd" class="in-width h-large b-grey">
	                    </div>
                    </div>
                    <div class="control-group">
	                    <label class="lb-name">再次输入密码</label>
	                    <div class="controls">
	                      <input type="password" name="copy_pwd" class="in-width h-large b-grey">
	                    </div>
                    </div>
                    <div class="help-block">已经有登录账号和密码？<a href="javascript:void(0);" onclick="loginDom()">去登录>></a></div>
                    <div class="controls">
                      <button class="btn btn-primary btn-login" id="register_btn" disabled>马上注册</button>
                    </div>
                </form>
                <?php if(isset($tips_sms['register'])){?>
                <div class="alert <?php echo $tips_sms['register']['type']; ?>">
                	<button type="button" class="close" data-dismiss="alert">×</button>
                	<strong><?php echo $tips_sms['register']['title']; ?></strong><?php echo $tips_sms['register']['info']; ?></div>
                <?php }?>
           </div>
        </div>
    </div>
    
    <div class="footer-bottom">
        <div class="container">
            <p>&copy; 2013 by iceberg, All rights reserved.</p>
        </div>
    </div>

    <!-- Le javascript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="js/jquery-1.7.2.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script>
    $(function(){
        var dom_show = '<?php echo $tips_sms['dom_show'];?>';
        if(dom_show == 'login')
        {
        }else{
        	$('.form-login .container').eq(0).css('margin-top','-440px');
        }
        $('#register_dom input[name=user]').click(function(){
    		$('#register_dom input[name=user]').siblings().remove();
    		$('#register_dom input[name=user]').parents('div[class=control-group error]').removeClass('error');
		});
        $('#register_dom input[name=user]').change(function(){
            $('#register_btn').attr('disabled',true);
        	var user = $('#register_dom input[name=user]').val();
        	if(user.length < 4){
        		$('#register_dom input[name=user]').siblings().remove();
            	$('#register_dom input[name=user]').after('<span class="help-inline">*用户名不能少于4个字符</span>').parents('div[class=control-group]').addClass('error');
        	}else{
        		$.post('<?php echo site_url('common/pass_name');?>',{'name':user},function(data){
        			if(data == 1){
        				$('#register_dom input[name=user]').siblings().remove();
        				$('#register_dom input[name=user]').after('<span class="help-inline">*该用户名已被注册！</span>').parents('div[class=control-group]').addClass('error');
        			}else{
        				$('#register_btn').removeAttr('disabled');
        			}
            	});
        	}
        });
    });
    function formVerific(dom)
    {
        var e = 0;
        if(dom == 'register')
        {
            var pwd = $('#register_dom input[name=pwd]').val();
            var copy_pwd = $('#register_dom input[name=copy_pwd]').val();
			        	if(pwd.length < 6)
			        	{
        	            	$('#register_dom input[name=pwd]').siblings().remove();
        	            	$('#register_dom input[name=pwd]').after('<span class="help-inline">*安全起见，密码不能少于6个字符</span>').parents('div[class=control-group]').addClass('error');
        	            	$('#register_dom input[name=pwd]').click(function(){
        	            		$('#register_dom input[name=pwd]').siblings().remove();
        	            		$('#register_dom input[name=pwd]').parents('div[class=control-group error]').removeClass('error');
        	        		});
        	            	return false;
        	            }else{
        	            	if(pwd != copy_pwd)
            	            {
            	            	$('#register_dom input[name=copy_pwd]').siblings().remove();
            	            	$('#register_dom input[name=copy_pwd]').after('<span class="help-inline">*再次输入一遍登录密码，验证密码的可靠性.</span>').parents('div[class=control-group]').addClass('error');
            	            	$('#register_dom input[name=copy_pwd]').click(function(){
            	            		$('#register_dom input[name=copy_pwd]').siblings().remove();
            	            		$('#register_dom input[name=copy_pwd]').parents('div[class=control-group error]').removeClass('error');
            	    			});
            	            	return false;
            	            }else{
                	            return true;
            	            }
        	            }
        }else if(dom == 'login')
        {
        }
    }
    function registerDom()
    {
        $('.form-login .container').eq(0).animate({'margin-top':'-440'},'slow',function(){
            $('.logo-login').html('<h1>注册成为本站用户</h1><h5>详细填写以下信息创建账户</h5>');
        });
    }
    function loginDom()
    {
        $('.form-login .container').eq(0).animate({'margin-top':'0'},'slow',function(){
            $('.logo-login').html('<h1>登录用户中心</h1><h5>输入您的用户名和正确的密码</h5>');
        });
    }
    </script>
  </body>
</html>